package com.rockcent.mall.helper;

import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.Banner;
import com.rockcent.mall.lib.dto.BannerDto;
import com.rockcent.mall.lib.helper.BaseUserHelper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * Banner信息处理辅助类
 * Created by zhangjh on 2016/11/11.
 */
@Component
public class BannerHelper  extends BaseUserHelper {

    /**
     * dto转domain
     * @param dto
     * @return
     */
    public Banner chgCtoToDomain(BannerDto dto) {
        Banner banner = new Banner();
        banner.setTitle(dto.getTitle());
        banner.setSeqNo(dto.getSeqNo());
        banner.setUrl(dto.getUrl());
        banner.setPicPath(dto.getPicPath());
        banner.setIsDelete(Whether.NO);
        banner.setId(dto.getId());
        return  banner;

    }
}
